#include "../../common/commonbase.h"
#include "../../common/config.h"
#include "/usr/local/mysql/include/mysql.h"

namespace XIAOO{
    class DbMysql{
        public:
            DbMysql();
            ~DbMysql();
            
        public:
            int query(std::string sql, Json::Value *root);
            int queryOne(std::string sql, Json::Value *root);
            int insert(std::string sql, int *lastInsertId);

        private:
            void _connect();
            void _printSql(std::string sql);
        private:
            MYSQL conn;
            bool isConn;
            bool isDebug;
    };
}